package com.terren.spider.entity.core;

public enum DataType {
	STRING(1,""), 
	DOUBLE(2,""), 
	INTEGER(3,""),
	
	
	
	YEAR(4,"yyyy"),
	MONTH(5,"MM"),
	DAY(6,"dd"),
	HOUR(7,"HH"),
	MINUTE(8,"mm"),
	SECOND(9,"ss");
	
	
	
	private int typeValue;
	private String  typeReplace;

	DataType(int typeValue, String typeReplace) {
		this.typeValue = typeValue;
		this.typeReplace = typeReplace;
	}

	public static DataType valueOfType(int typeValue) {
		for (DataType datatype : values()) {
			if (datatype.typeValue == typeValue) {
				return datatype;
			}
		}
		return null;
	}
	public static DataType replaceOfType(String typeReplace) {
		for (DataType datatype : values()) {
			if (datatype.typeReplace.equals(typeReplace)) {
				return datatype;
			}
		}
		return null;
	}

	public int getTypeValue() {
		return typeValue;
	}

	public void setTypeValue(int typeValue) {
		this.typeValue = typeValue;
	}

	public String getTypeReplace() {
		return typeReplace;
	}

	public void setTypeReplace(String typeReplace) {
		this.typeReplace = typeReplace;
	}

	
}
